function fctValFreq()
{
	var sValue = document.getElementById("genf_freq").value;
	var fValue = 0;
	var aObjects = new Array(17);
	var iI=1;
	var sTemp="";
	
	var s3DL1 = document.getElementById("kgen_3dl1").value;	
	aObjects[1] = document.getElementById("kgen_3dl1");	
	var s2DL1 = document.getElementById("kgen_2dl1").value;
	aObjects[2] = document.getElementById("kgen_2dl1");	
	var s2DL3 = document.getElementById("kgen_2dl3").value;
	aObjects[3] = document.getElementById("kgen_2dl3");	
	var s2DS4 = document.getElementById("kgen_2ds4").value;
	aObjects[4] = document.getElementById("kgen_2ds4");	
	var s2DL2 = document.getElementById("kgen_3dl2").value;
	aObjects[5] = document.getElementById("kgen_3dl2");	
	var s2DL5 = document.getElementById("kgen_2dl5").value;
	aObjects[6] = document.getElementById("kgen_2dl5");	
	var s3DS1 = document.getElementById("kgen_3ds1").value;
	aObjects[7] = document.getElementById("kgen_3ds1");	
	var s2DS1 = document.getElementById("kgen_2ds1").value;
	aObjects[8] = document.getElementById("kgen_2ds1");	
	var s2DS2 = document.getElementById("kgen_2ds2").value;
	aObjects[9] = document.getElementById("kgen_2ds2");	
	var s2DS3 = document.getElementById("kgen_2ds3").value;
	aObjects[10] = document.getElementById("kgen_2ds3");	
	var s2DS5 = document.getElementById("kgen_2ds5").value;
	aObjects[11] = document.getElementById("kgen_2ds5");	
	var s2DL4 = document.getElementById("kgen_2dl4").value;
	aObjects[12] = document.getElementById("kgen_2dl4");	
	var s3DL2 = document.getElementById("kgen_3dl2").value;
	aObjects[13] = document.getElementById("kgen_3dl2");	
	var s3DL3 = document.getElementById("kgen_3dl3").value;
	aObjects[14] = document.getElementById("kgen_3dl3");	
	var s2DP1 = document.getElementById("kgen_2dp1").value;
	aObjects[15] = document.getElementById("kgen_2dp1");	
	var s3DP1 = document.getElementById("kgen_3dp1").value;
	aObjects[16] = document.getElementById("kgen_3dp1");	
	
	//... Verify that at least one locus is selected ...//'
	if((s3DL1=="")&&(s2DL1=="")&&(s2DL3=="")&&(s2DS4=="")&&(s2DL2=="")&&(s2DL5=="")&&(s3DS1=="")&&(s2DS1=="")&&(s2DS2=="")&&(s2DS3=="")&&(s2DS5=="")&&(s2DL4=="")&&(s3DL2=="")&&(s3DL3=="")&&(s2DP1=="")&&(s3DP1==""))
	{
		alert("Please select at least one locus.");
		document.getElementById("kgen_3dl1").focus();
		return false;		
	}
	//... Verify that the content of each locus is valid ...//'
	while(iI<=16)
	{
		if (aObjects[iI].value != "1" && aObjects[iI].value != "0" && aObjects[iI].value != "" && aObjects[iI].value != "n")
		{
			sTemp = aObjects[iI].name;
			sTemp = sTemp.toUpperCase();
			sTemp = sTemp.substring(5);
			alert("Invalid value for " + sTemp + " locus. Type 1 for positives, 0 for negatives, n for not tested or leave empty.");
			document.getElementById("kgen_" + sTemp.toLowerCase()).focus();
			return false;
		}
		iI++;
	}
	
	if(IsNumeric(sValue))
	{
		fValue = parseFloat(sValue);
		//... Validating Phenotype Frequency ...//
		if((fValue<0.0)||(fValue>100.0))
		{
			alert("Invalid data: '" + sValue +"'. Type a frequency between (0.0 and 100.0).");
			document.getElementById("genf_freq").focus();
			return false;
		}
		else
		{				
				//... Giving format to variables ...//
				document.getElementById("genf_freq").value = fValue.toFixed(1); //... To one decimal ...//
				document.frmkir2002a.submit();
				return true;
		}
	}
	else
	{
			alert("Invalid data: '" + sValue +"'. Type a number between (0.0 and 100.0).");
			document.getElementById("genf_freq").focus();
			return false;
	}
}
function fctPaintLocus(objItem)
{
	if (objItem.value == "1")
	{
		objItem.style.background = "#aaaaaa";
	}
	if (objItem.value == "0" || objItem.value == "")
	{
		objItem.style.background = "#ffffff";
	}
	if (objItem.value == "n")
	{
		objItem.style.background = "#ffc000";
	}
	if (objItem.value != "1" && objItem.value != "0" && objItem.value != "" && objItem.value != "n")
	{
		objItem.style.background = "#ff0000";
		alert("Invalid value for this locus. Type 1 for positives, 0 for negatives, n for not tested or leave empty.");
		objItem.focus();
		return false;
	}
	else
	{
		return true;
	}
}
